1 Public Class frmSetPass
2
3    
4     Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
5         If CheckBox1.CheckState = CheckState.Checked Then
6             txtPass.UseSystemPasswordChar = False
7         Else
8             txtPass.UseSystemPasswordChar = True
9         End If
10     End Sub
11
12     Private Sub frmSetPass_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
13         txtPass.UseSystemPasswordChar = True
14     End Sub
15
16     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
17         If txtUser.Text =
"" Then
18             MsgBox(
"Please Enter your user name")
19             txtUser.Focus()
20         ElseIf txtPass.Text =
"" Then
21             MsgBox(
"Please Enter your Password")
22             txtPass.Focus()
23
24         Else
25             My.Settings.user = txtUser.Text
26             My.Settings.pass = txtPass.Text
27             My.Settings.Save()
28
29             MsgBox(
"User Name And Password Save Successfully")
30             Me.Close()
31         End If
32     End Sub
33
34     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
35         Application.Exit()
36     End Sub
37 End Class


Gõ tìm kiếm nhanh...